home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / UPDATE- Int&Libs 3.2 / AIncludes / Folders.a < prev    next >
Encoding:
Text File  |  1999-05-25  |  13.3 KB  |  374 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Folders.a
  3. ;
  4. ;    Contains:    Folder Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Veronica Seed, Use with 3.2 Universal Interfaces
  8. ;
  9. ;    Copyright:    © 1995-1999 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__FOLDERS__') = 'UNDEFINED' THEN
  18. __FOLDERS__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.  
  24.  
  25. kOnSystemDisk                    EQU        -32768                ; previously was 0x8000 but that is an unsigned value whereas vRefNum is signed
  26.  
  27. kCreateFolder                    EQU        1
  28. kDontCreateFolder                EQU        0
  29.  
  30. kSystemFolderType                EQU        'macs'                ; the system folder 
  31. kDesktopFolderType                EQU        'desk'                ; the desktop folder; objects in this folder show on the desk top. 
  32. kTrashFolderType                EQU        'trsh'                ; the trash folder; objects in this folder show up in the trash 
  33. kWhereToEmptyTrashFolderType    EQU        'empt'                ; the "empty trash" folder; Finder starts empty from here down 
  34. kPrintMonitorDocsFolderType        EQU        'prnt'                ; Print Monitor documents 
  35. kStartupFolderType                EQU        'strt'                ; Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here 
  36. kShutdownFolderType                EQU        'shdf'                ; Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here 
  37. kAppleMenuFolderType            EQU        'amnu'                ; Finder objects to put into the Apple menu go here 
  38. kControlPanelFolderType            EQU        'ctrl'                ; Control Panels go here (may contain INITs) 
  39. kExtensionFolderType            EQU        'extn'                ; System extensions go here 
  40. kFontsFolderType                EQU        'font'                ; Fonts go here 
  41. kPreferencesFolderType            EQU        'pref'                ; preferences for applications go here 
  42. kTemporaryFolderType            EQU        'temp'                ; temporary files go here (deleted periodically, but don't rely on it.) 
  43. ;    Note:     The FindFolder trap was not implemented until System 7.  If you want to call FindFolder
  44. ;            while running on System 6 machines, then define USE_FINDFOLDER_GLUE and link with
  45. ;            Interface.o which contains glue to implement FindFolder on pre-System 7 machines.
  46. ;
  47.  
  48.     IF &TYPE('USE_FINDFOLDER_GLUE') <> 'UNDEFINED' THEN
  49. ;
  50. ; pascal OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  51. ;
  52.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  53.         IMPORT_CFM_FUNCTION FindFolder
  54.     ENDIF
  55.  
  56.     ELSE
  57. ;
  58. ; pascal OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID)
  59. ;
  60.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  61.         Macro
  62.         _FindFolder
  63.             moveq               #0,D0
  64.             dc.w                $A823
  65.         EndM
  66.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  67.         IMPORT_CFM_FUNCTION FindFolder
  68.     ENDIF
  69.  
  70.     ENDIF
  71. ;
  72. ; pascal OSErr ReleaseFolder(short vRefNum, OSType folderType)
  73. ;
  74.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  75.         Macro
  76.         _ReleaseFolder
  77.             moveq               #11,D0
  78.             dc.w                $A823
  79.         EndM
  80.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  81.         IMPORT_CFM_FUNCTION ReleaseFolder
  82.     ENDIF
  83.  
  84.  
  85.     IF (forCarbon ++ TARGET_OS_UNIX ++ TARGET_OS_WIN32) THEN
  86. ;  Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  87. ;   the found folder path.
  88.  
  89. ;
  90. ; extern OSErr FindFolderEx(short vRefNum, OSType folderType, Boolean createFolder, short *foundVRefNum, long *foundDirID, char *foundFolder)
  91. ;
  92.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  93.         IMPORT_CFM_FUNCTION FindFolderEx
  94.     ENDIF
  95.  
  96.     ENDIF
  97. ; *****************************************
  98. ;  Extensible Folder Manager declarations 
  99. ; *****************************************
  100.  
  101. ; ***************************
  102. ;  Folder Manager constants 
  103. ; ***************************
  104.  
  105.  
  106. kExtensionDisabledFolderType    EQU        'extD'
  107. kControlPanelDisabledFolderType    EQU        'ctrD'
  108. kSystemExtensionDisabledFolderType EQU    'macD'
  109. kStartupItemsDisabledFolderType    EQU        'strD'
  110. kShutdownItemsDisabledFolderType EQU    'shdD'
  111. kApplicationsFolderType            EQU        'apps'
  112. kDocumentsFolderType            EQU        'docs'
  113.  
  114.                                                             ; new constants 
  115. kVolumeRootFolderType            EQU        'root'                ; root folder of a volume 
  116. kChewableItemsFolderType        EQU        'flnt'                ; items deleted at boot 
  117. kApplicationSupportFolderType    EQU        'asup'                ; third-party items and folders 
  118. kTextEncodingsFolderType        EQU        'ƒtex'                ; encoding tables 
  119. kStationeryFolderType            EQU        'odst'                ; stationery 
  120. kOpenDocFolderType                EQU        'odod'                ; OpenDoc root 
  121. kOpenDocShellPlugInsFolderType    EQU        'odsp'                ; OpenDoc Shell Plug-Ins in OpenDoc folder 
  122. kEditorsFolderType                EQU        'oded'                ; OpenDoc editors in MacOS Folder 
  123. kOpenDocEditorsFolderType        EQU        'ƒodf'                ; OpenDoc subfolder of Editors folder 
  124. kOpenDocLibrariesFolderType        EQU        'odlb'                ; OpenDoc libraries folder 
  125. kGenEditorsFolderType            EQU        'ƒedi'                ; CKH general editors folder at root level of Sys folder 
  126. kHelpFolderType                    EQU        'ƒhlp'                ; CKH help folder currently at root of system folder 
  127. kInternetPlugInFolderType        EQU        'ƒnet'                ; CKH internet plug ins for browsers and stuff 
  128. kModemScriptsFolderType            EQU        'ƒmod'                ; CKH modem scripts, get 'em OUT of the Extensions folder 
  129. kPrinterDescriptionFolderType    EQU        'ppdf'                ; CKH new folder at root of System folder for printer descs. 
  130. kPrinterDriverFolderType        EQU        'ƒprd'                ; CKH new folder at root of System folder for printer drivers 
  131. kScriptingAdditionsFolderType    EQU        'ƒscr'                ; CKH at root of system folder 
  132. kSharedLibrariesFolderType        EQU        'ƒlib'                ; CKH for general shared libs. 
  133. kVoicesFolderType                EQU        'fvoc'                ; CKH macintalk can live here 
  134. kControlStripModulesFolderType    EQU        'sdev'                ; CKH for control strip modules 
  135. kAssistantsFolderType            EQU        'astƒ'                ; SJF for Assistants (MacOS Setup Assistant, etc) 
  136. kUtilitiesFolderType            EQU        'utiƒ'                ; SJF for Utilities folder 
  137. kAppleExtrasFolderType            EQU        'aexƒ'                ; SJF for Apple Extras folder 
  138. kContextualMenuItemsFolderType    EQU        'cmnu'                ; SJF for Contextual Menu items 
  139. kMacOSReadMesFolderType            EQU        'morƒ'                ; SJF for MacOS ReadMes folder 
  140. kALMModulesFolderType            EQU        'walk'                ; EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType) 
  141. kALMPreferencesFolderType        EQU        'trip'                ; EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType) 
  142. kALMLocationsFolderType            EQU        'fall'                ; EAS for Location Manager Locations (within kALMPreferencesFolderType) 
  143. kColorSyncProfilesFolderType    EQU        'prof'                ; for ColorSync™ Profiles 
  144. kThemesFolderType                EQU        'thme'                ; for Theme data files 
  145. kFavoritesFolderType            EQU        'favs'                ; Favorties folder for Navigation Services 
  146. kInternetFolderType                EQU        'intƒ'                ; Internet folder (root level of startup volume) 
  147. kAppearanceFolderType            EQU        'appr'                ; Appearance folder (root of system folder) 
  148. kSoundSetsFolderType            EQU        'snds'                ; Sound Sets folder (in Appearance folder) 
  149. kDesktopPicturesFolderType        EQU        'dtpƒ'                ; Desktop Pictures folder (in Appearance folder) 
  150. kInternetSearchSitesFolderType    EQU        'issf'                ; Internet Search Sites folder 
  151. kFindSupportFolderType            EQU        'fnds'                ; Find support folder 
  152. kFindByContentFolderType        EQU        'fbcf'                ; Find by content folder 
  153. kInstallerLogsFolderType        EQU        'ilgf'                ; Installer Logs folder 
  154. kScriptsFolderType                EQU        'scrƒ'                ; Scripts folder 
  155. kFolderActionsFolderType        EQU        'fasf'                ; Folder Actions Scripts folder 
  156. kLauncherItemsFolderType        EQU        'laun'                ; Launcher Items folder 
  157. kRecentApplicationsFolderType    EQU        'rapp'                ; Recent Applications folder 
  158. kRecentDocumentsFolderType        EQU        'rdoc'                ; Recent Documents folder 
  159. kRecentServersFolderType        EQU        'rsvr'                ; Recent Servers folder 
  160. kSpeakableItemsFolderType        EQU        'spki'                ; Speakable Items folder 
  161. kKeychainFolderType                EQU        'kchn'                ; Keychain folder 
  162. kQuickTimeExtensionsFolderType    EQU        'qtex'                ; QuickTime Extensions Folder (in Extensions folder) 
  163.  
  164. kLocalesFolderType                EQU        'ƒloc'                ; PKE for Locales folder 
  165. kFindByContentPluginsFolderType    EQU        'fbcp'                ; Find By Content Plug-ins 
  166. ;  FolderDescFlags values 
  167.  
  168. kCreateFolderAtBoot                EQU        $00000002
  169. kFolderCreatedInvisible            EQU        $00000004
  170. kFolderCreatedNameLocked        EQU        $00000008
  171. ; typedef UInt32                         FolderDescFlags
  172.  
  173. ;  FolderClass values 
  174.  
  175. kRelativeFolder                    EQU        'relf'
  176. kSpecialFolder                    EQU        'spcf'
  177. ; typedef OSType                         FolderClass
  178.  
  179. ;  special folder locations 
  180.  
  181. kBlessedFolder                    EQU        'blsf'
  182. kRootFolder                        EQU        'rotf'
  183. ; typedef OSType                         FolderType
  184.  
  185. ; typedef OSType                         FolderLocation
  186.  
  187.  
  188. FolderDesc                RECORD 0
  189. descSize                 ds.l    1                ; offset: $0 (0)
  190. foldType                 ds.l    1                ; offset: $4 (4)
  191. flags                     ds.l    1                ; offset: $8 (8)
  192. foldClass                 ds.l    1                ; offset: $C (12)
  193. foldLocation             ds.l    1                ; offset: $10 (16)
  194. badgeSignature             ds.l    1                ; offset: $14 (20)
  195. badgeType                 ds.l    1                ; offset: $18 (24)
  196. reserved                 ds.l    1                ; offset: $1C (28)
  197. name                     ds        StrFileName        ; offset: $20 (32)        ;  Str63 on MacOS
  198. sizeof                     EQU *                    ; size:   $60 (96)
  199.                         ENDR
  200. ; typedef struct FolderDesc *            FolderDescPtr
  201.  
  202.  
  203. ; typedef UInt32                         RoutingFlags
  204.  
  205. FolderRouting            RECORD 0
  206. descSize                 ds.l    1                ; offset: $0 (0)
  207. fileType                 ds.l    1                ; offset: $4 (4)
  208. routeFromFolder             ds.l    1                ; offset: $8 (8)
  209. routeToFolder             ds.l    1                ; offset: $C (12)
  210. flags                     ds.l    1                ; offset: $10 (16)
  211. sizeof                     EQU *                    ; size:   $14 (20)
  212.                         ENDR
  213. ; typedef struct FolderRouting *        FolderRoutingPtr
  214.  
  215. ;  routing constants 
  216. ; **************************
  217. ;  Folder Manager routines 
  218. ; **************************
  219. ;  Folder Manager administration routines 
  220. ;
  221. ; pascal OSErr AddFolderDescriptor(FolderType foldType, FolderDescFlags flags, FolderClass foldClass, FolderLocation foldLocation, OSType badgeSignature, OSType badgeType, ConstStrFileNameParam name, Boolean replaceFlag)
  222. ;
  223.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  224.         Macro
  225.         _AddFolderDescriptor
  226.             moveq               #32,D0
  227.             dc.w                $A823
  228.         EndM
  229.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  230.         IMPORT_CFM_FUNCTION AddFolderDescriptor
  231.     ENDIF
  232.  
  233. ;
  234. ; pascal OSErr GetFolderDescriptor(FolderType foldType, Size descSize, FolderDesc *foldDesc)
  235. ;
  236.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  237.         Macro
  238.         _GetFolderDescriptor
  239.             moveq               #35,D0
  240.             dc.w                $A823
  241.         EndM
  242.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  243.         IMPORT_CFM_FUNCTION GetFolderDescriptor
  244.     ENDIF
  245.  
  246. ;
  247. ; pascal OSErr GetFolderTypes(UInt32 requestedTypeCount, UInt32 *totalTypeCount, FolderType *theTypes)
  248. ;
  249.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  250.         Macro
  251.         _GetFolderTypes
  252.             moveq               #36,D0
  253.             dc.w                $A823
  254.         EndM
  255.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  256.         IMPORT_CFM_FUNCTION GetFolderTypes
  257.     ENDIF
  258.  
  259. ;
  260. ; pascal OSErr RemoveFolderDescriptor(FolderType foldType)
  261. ;
  262.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  263.         Macro
  264.         _RemoveFolderDescriptor
  265.             moveq               #33,D0
  266.             dc.w                $A823
  267.         EndM
  268.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  269.         IMPORT_CFM_FUNCTION RemoveFolderDescriptor
  270.     ENDIF
  271.  
  272. ;  legacy routines 
  273. ;
  274. ; pascal OSErr GetFolderName(short vRefNum, OSType foldType, short *foundVRefNum, StrFileName name)
  275. ;
  276.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  277.         Macro
  278.         _GetFolderName
  279.             moveq               #14,D0
  280.             dc.w                $A823
  281.         EndM
  282.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  283.         IMPORT_CFM_FUNCTION GetFolderName
  284.     ENDIF
  285.  
  286. ;  routing routines 
  287. ;
  288. ; pascal OSErr AddFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType routeToFolder, RoutingFlags flags, Boolean replaceFlag)
  289. ;
  290.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  291.         Macro
  292.         _AddFolderRouting
  293.             moveq               #38,D0
  294.             dc.w                $A823
  295.         EndM
  296.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  297.         IMPORT_CFM_FUNCTION AddFolderRouting
  298.     ENDIF
  299.  
  300. ;
  301. ; pascal OSErr RemoveFolderRouting(OSType fileType, FolderType routeFromFolder)
  302. ;
  303.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  304.         Macro
  305.         _RemoveFolderRouting
  306.             moveq               #39,D0
  307.             dc.w                $A823
  308.         EndM
  309.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  310.         IMPORT_CFM_FUNCTION RemoveFolderRouting
  311.     ENDIF
  312.  
  313. ;
  314. ; pascal OSErr FindFolderRouting(OSType fileType, FolderType routeFromFolder, FolderType *routeToFolder, RoutingFlags *flags)
  315. ;
  316.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  317.         Macro
  318.         _FindFolderRouting
  319.             moveq               #34,D0
  320.             dc.w                $A823
  321.         EndM
  322.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  323.         IMPORT_CFM_FUNCTION FindFolderRouting
  324.     ENDIF
  325.  
  326. ;
  327. ; pascal OSErr GetFolderRoutings(UInt32 requestedRoutingCount, UInt32 *totalRoutingCount, Size routingSize, FolderRouting *theRoutings)
  328. ;
  329.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  330.         Macro
  331.         _GetFolderRoutings
  332.             moveq               #30,D0
  333.             dc.w                $A823
  334.         EndM
  335.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  336.         IMPORT_CFM_FUNCTION GetFolderRoutings
  337.     ENDIF
  338.  
  339. ;
  340. ; pascal OSErr InvalidateFolderDescriptorCache(short vRefNum, long dirID)
  341. ;
  342.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  343.         Macro
  344.         _InvalidateFolderDescriptorCache
  345.             moveq               #37,D0
  346.             dc.w                $A823
  347.         EndM
  348.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  349.         IMPORT_CFM_FUNCTION InvalidateFolderDescriptorCache
  350.     ENDIF
  351.  
  352. ;
  353. ; pascal OSErr IdentifyFolder(short vRefNum, long dirID, FolderType *foldType)
  354. ;
  355.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  356.         Macro
  357.         _IdentifyFolder
  358.             moveq               #31,D0
  359.             dc.w                $A823
  360.         EndM
  361.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  362.         IMPORT_CFM_FUNCTION IdentifyFolder
  363.     ENDIF
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.     ENDIF ; __FOLDERS__ 
  371.  
  372.